package com.liit.module.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.liit.module.dao.OnlineLinkDao;
import com.liit.module.entity.OnlineLink;
import com.liit.module.frame.utils.page.Pagination;
import com.liit.module.service.OnlineLinkService;

/**
 * @author dingweibo
 * @Title: OnlineLinkServiceImpl.java
 * @Description: 线上购物服务实现
 * @date 2015年12月21日
 */
@Service("onlineLinkService")
public class OnlineLinkServiceImpl implements OnlineLinkService {

	@Resource
	OnlineLinkDao onlineLinkDao;

	@Override
	public int insertAndReturnPK(OnlineLink record) {
		onlineLinkDao.insert(record);
		return record.getId();
	}

	@Override
	public OnlineLink selectById(Integer id) {
		return onlineLinkDao.selectById(id);
	}

	@Override
	public int updateById(OnlineLink record) {
		return onlineLinkDao.updateById(record);
	}

	@Override
	public Map<String, Object> listPage(Pagination pagination, OnlineLink record) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("list", onlineLinkDao.listPage(pagination, record));
		result.put("page", pagination);
		return result;
	}

	@Override
	public int deleteById(Integer id) {
		return onlineLinkDao.deleteById(id);
	}

}
